package cn.fw.community.adapter.facade.track.api;

import cn.fw.community.client.api.tracking.TrackClient;
import cn.fw.community.client.model.req.TrackIngContextDo;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.gitee.chearnee.fw.common.model.vo.ResultVo;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author cn
 * @version 1.0
 * @description
 * @date 2022/9/28 16:51
 */
@RestController
@RequiredArgsConstructor
public class TrackServiceController implements TrackClient {
    private final ObjectMapper objectMapper;

    @Override
    @SneakyThrows
    public ResultVo<Boolean> tracking(TrackIngContextDo tracking) {
        objectMapper.writeValueAsString(tracking);
        return ResultVo.success(true);
    }

    @Override
    @SneakyThrows
    public ResultVo<Boolean> tracksing(List<TrackIngContextDo> tracking) {
        objectMapper.writeValueAsString(tracking);
        return ResultVo.success(true);
    }
}
